package com.moloon.game.sanguo.editor.propseditor.view.mission;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.forms.SectionPart;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.Section;

public class MissionLocationSection extends SectionPart {

	private Table table;

	/**
	 * Create the SectionPart
	 * 
	 * @param parent
	 * @param toolkit
	 * @param style
	 */
	public MissionLocationSection(Composite parent, FormToolkit toolkit,
			int style) {
		super(parent, toolkit, style);
		createClient(getSection(), toolkit);
	}

	/**
	 * Fill the section
	 */
	private void createClient(Section section, FormToolkit toolkit) {
		section.setText("任务地点");
		ToolBar tbar = new ToolBar(section, SWT.FLAT | SWT.HORIZONTAL);
		ToolItem titem = new ToolItem(tbar, SWT.NULL);
		titem.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(
				ISharedImages.IMG_TOOL_NEW_WIZARD));
		titem = new ToolItem(tbar, SWT.NULL);
		titem.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(
				ISharedImages.IMG_TOOL_CUT));
		section.setTextClient(tbar);

		Composite container = toolkit.createComposite(section);
		container.setLayout(new FillLayout());
		//
		section.setClient(container);

		table = toolkit.createTable(container, SWT.NONE);
		table.setLinesVisible(true);
		table.setHeaderVisible(true);
		
		TableColumn tc = new TableColumn(table, SWT.NONE);
		tc.setText("名称");
		tc.setWidth(100);
		
		tc = new TableColumn(table, SWT.NONE);
		tc.setText("地图");
		tc.setWidth(100);
		
		tc = new TableColumn(table, SWT.NONE);
		tc.setText("X坐标");
		tc.setWidth(100);
		
		tc = new TableColumn(table, SWT.NONE);
		tc.setText("Y坐标");
		tc.setWidth(100);
		
		tc = new TableColumn(table, SWT.NONE);
		tc.setText("缺省传送点");
		tc.setWidth(100);
	}

}
